﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IoCTechDay.MAC
{
    public class MACDemo
    {
        public static void Run()
        {
            Console.Clear();
            Console.WriteLine("Running MAC Demo..");
            
            // Create the Container and Configure.
            MAC container = new MAC();

            container.Register(() => new CupOfCoffee(
                                         new TeaSpoonOfSugar()));
            container.Register(() => 
                new robcthegeek(new BagOfChocolatePeanuts(), container.Get<CupOfCoffee>()));

            // Now Get a "robcthegeek" from the Container..
            // Note here we are not needing to spin up dependencies.
            var rob = container.Get<robcthegeek>();
            rob.GeekOut();

            Console.WriteLine("Please Press Enter..");
            Console.ReadLine();
        }
    }
}
